/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.javatrainning.duongnt.b1;

import java.util.Scanner;

/**
 *
 * @author ThuyDuong
 */
public class Bai2Muc1UCLN {
     public static int  ucln(int a,int b){
        while(a*b!=0){
            if(a>b) a=a%b;
            else b=b%a;}
            return a+b;
    }
    public static int a,b;
    public static void main(String[] args){
    System.out.println ("nhap a,b");
    Scanner sc =new Scanner (System.in);
    a= sc.nextInt();
     b= sc.nextInt();
        System.out.println("uoc chung lon nhat cua"+a+"va"+b+"la:"+ucln(a,b));
    }
}
